let href = location.href
console.log('href=' + href)
let pathname = location.pathname
console.log('pathname' + pathname)
let host = location.host
console.log('host' + host)
let hostName = location.hostname
console.log(' hostName' + hostName)
let search = location.search
console.log('search' + search)
let port = location.port
console.log('port' + port)
let portocol = location.portocol
console.log('portocol')
//找到class=link-btn
let linkBtn = document.querySelector('.link-btn')
linkBtn.onclick = function () {
    //手动指定一个页面的地址，让浏览器进行页面的跳转
    location = './demo2.html?username=admin&password=123456'
    //不能返回的跳转
    location.replace('./demo2.html?username=admin&password=123456')
}